﻿@using Share.Models
@{
    ViewBag.Title = "Home Page";
    List<Adv> Advs = (List<Adv>)App.Advs;
    Adv Banner = Advs.Where(a=>a.Position==(int)Adv.POSITION.HomeBanner).First();
    List<Adv> Promotions = Advs.Where(a => a.Position == (int)Adv.POSITION.HomePromotion).ToList();
    
    <div id="banner" class="carousel slide">
        <!-- Carousel items -->
        <div class="carousel-inner">
            <div class="active item"><a href="@Banner.Url"><img src="@Banner.Photo"></a></div>
        </div>
        <!-- Carousel nav -->
        <a class="carousel-control left" href="#banner" data-slide="prev">&lsaquo;</a>
        <a class="carousel-control right" href="#banner" data-slide="next">&rsaquo;</a>
    </div>
    <div id="promotions" class="row">
        @foreach (Adv adv in Promotions)
        {
        <div class="span3"><a class="thumbnail" href="@adv.Url"><img src="@adv.Photo"></a></div>
        }
    </div>
    <script>
        $('.carousel').carousel()
    </script>
}
